<?php
	//require_once("./model/dictionaries/edinici_izmerenija.inc");
	//require_once("./model/dictionaries/сотрудники.inc");
	//require_once("./model/dictionaries/пол.inc");
	//require_once("./classes/nwmainform.php");
	//require_once("./model/dictionaries/navigator.inc");
	//require_once("./classes/GUI/nwmenu.php");
	//require_once("./classes/System/osmetadata.php");
	//
	//require_once("./test.php");
	require_once($_SERVER['DOCUMENT_ROOT']."/classes/interface/osuserinterface.php");
	//require_once($_SERVER['DOCUMENT_ROOT']."/classes/interface/oscomponent.php");
	@session_start();

	$answer = array();
	$_SESSION['answer'] = &$answer;

/*
	$element = $_REQUEST['element'];
	$event = $_REQUEST['event'];
	$param1 = $_REQUEST['param1'];
	$param2 = $_REQUEST['param2'];
*/

	$component = $_REQUEST['element'];
	$function = $_REQUEST['event'];
	$param1 = $_REQUEST['param1'];
	$param2 = $_REQUEST['param2'];
	//$temp = &$_SESSION[$element];
	//$temp->$event($param1,$param2);
	//$_SESSION["userinterface"]->message($element, $event, $param1, $param2);
	$_SESSION["components"][$component]->{$function}($param1,$param2);

	echo json_encode($answer);
	//echo $component." ".$function;
	
	//unset($answer);
	$answer = array();
	$_SESSION['answer'] = &$answer;
?>
